<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Add Item</title>
</head>
<body>
	
		<table>
			<tr>
				<th align="left"><h2>Add Item Specification</h2>
				</th>
				<th><a
					href="<c:url value="/item/specification/searchitemspec"/>"
					class="bt_green"><span class="bt_green_lft"></span><strong>Back
							to Item list</strong><span class="bt_green_r"></span>
				</a>
				</th>
			</tr>
			<c:if test="${empty categories}">
				<tr>
					<td colspan="2" align="center"><font color="red"><sup>*</sup>
							The <label>Category</label> has not described yet, please follow this <a
							href="<c:url value="/master/category/searchCategory"/>">link</a> for further configuration</font>
					</td>
				</tr>
			</c:if>
			<c:if test="${empty types}">
				<tr>
					<td colspan="2" align="center"><font color="red"><sup>*</sup>
							The <label>Type</label> has not described yet, please follow this <a
							href="<c:url value="/master/type/searchType"/>">link</a> for further configuration</font>
					</td>
				</tr>
			</c:if>
			<c:if test="${empty brand}">
				<tr>
					<td colspan="2" align="center"><font color="red"><sup>*</sup>
							The <label>Brand</label> has not described yet, please follow this <a
							href="<c:url value="/master/brand/searchBrand"/>">link</a> for further configuration</font>
					</td>
				</tr>
			</c:if>
			<tr>
				<td colspan="2">
					<form name="form" action="<c:url value="insertitemspec"/>" method="post">
					<table id="rounded-corner"
						summary="2007 Major IT Companies' Profit">
						<tr>
							<td align="right"><label>Code Unit :</label></td>
							<td><input type="text" class="input" name="code" size="40"
								value="" /></td>
						</tr>
						<tr>
							<td align="right"><label><sup>*</sup>Category :</label></td>
							<td><select name="Category.category" id="category">
									<c:forEach var="categories" items="${categories}"
										varStatus="status">
										<option value="${categories.id }">${categories.categoryName}</option>
									</c:forEach>
							</select></td>
						</tr>
						<tr>
							<td align="right"><label>Condition :</label></td>
							<td><select name="condition" id="condition">
									<option value="None">None</option>
									<option value="Good">Good</option>
									<option value="Rent">Rent</option>
									<option value="Broken">Broken</option>
							</select></td>
						</tr>
						<tr>
							<td align="right"><label><sup>*</sup>Type :</label></td>
							<td><select name="Type.type" id="type">
									<c:forEach var="types" items="${types}" varStatus="status">
										<option value="${types.id }">${types.itemType }</option>
									</c:forEach>
							</select></td>
						</tr>
						<tr>
							<td align="right"><label>Color :</label></td>
							<td><input type="text" class="input" name="color" size="40"
								value="" /></td>
						</tr>
						<tr>
							<td align="right"><label>Quantity :</label></td>
							<td><input type="text" class="input" name="qty" size="40"
								value="" /></td>
						</tr>
						<tr>
							<td align="right"><label>Size :</label></td>
							<td><input type="text" class="input" name="size" size="40"
								value="" /></td>
						</tr>
						<tr>
							<td align="right"><label><sup>*</sup>Brand :</label></td>
							<td><select name="Brand.brand" id="brand">
									<c:forEach var="brand" items="${brand}" varStatus="status">
										<option value="${brand.id }">${brand.brandName }</option>
									</c:forEach>
							</select></td>
						</tr>
						<tr>
							<td align="right"><label>Description :</label></td>
							<td><input type="text" class="input" name="description"
								size="40" value="" />
								<input type="hidden" class="input" name="status"
								value="1" />
							</td>
						</tr>
						<tr>
							<td align="right">
							<c:choose>
								<c:when test="${empty categories}">
									<input type="submit" value="Save" name="save" disabled/>
								</c:when>
								<c:when test="${empty types}">
									<input type="submit" value="Save" name="save" disabled/>
								</c:when>
								<c:when test="${empty brand}">
									<input type="submit" value="Save" name="save" disabled/>
								</c:when>
								<c:otherwise>
									<input type="submit" value="Save" name="save"/>
								</c:otherwise>
							</c:choose>
							</td>
							<td><input type="reset" value="Reset" class="button" />
							</td>
						</tr>
					</table>
					</form></td>
			</tr>
		</table>
	
</body>
</html>